using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Dimok.Data.DataSources;

namespace Data.DataSources {
	public class USIXCommentsDataSource : ObjectDataSourceBase {
		public override string SelectViewName { get { return "usix.t_Comment"; } }
		public override string InsertViewName { get { throw new NotImplementedException(); } }
		public int LoanID { set { SetSelectParameter(LOAN_ID, value); } }
		public string UsixID { set { SetSelectParameter(USIX_ID, value); } }
		public USIXCommentsDataSource() {
			OrderBy.Add("Date DESC,Agent,ID");
		}
		public DataView SelectEx(string UsixID,int CompanyID) {
			if( UsixID+"" != "" || Where.Count == 0 )
				return Select("[Id #]=@ID AND CompanyID=@CID", UsixID, CompanyID);
			return SelectEx();
		}
	}
}